<form class="form-horizontal" id="merchDetailForm">
    <input class="hidden" name="id" th:value="${merch.id}">

    <div class="box-body">
        <div class="form-group required">
            <label for="merchName" class="col-sm-3 control-label">商户名称 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${merch.merchName}" class="form-control" name="merchName" id="merchName"  require="必填项"  placeholder="">
            </div>
        </div>
        <div class="form-group">
            <label for="merchCompany" class="col-sm-3 control-label">公司名称 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${merch.merchCompany}" class="form-control" name="merchCompany" id="merchCompany" require="必填项" placeholder="">
            </div>
        </div>

        <div class="form-group">
            <label for="merchPhone" class="col-sm-3 control-label">联系电话 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${merch.merchPhone}" class="form-control" name="merchPhone" id="merchPhone" placeholder="">
            </div>
        </div>

        <div class="form-group">
            <label for="merchMail" class="col-sm-3 control-label">邮箱 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${merch.merchMail}" class="form-control" name="merchMail" id="merchMail" placeholder="">
            </div>
        </div>

        <div class="form-group">
            <label for="merchAddress" class="col-sm-3 control-label">联系地址 :</label>
            <div class="col-sm-8">
                <input type="text" th:value="${merch.merchAddress}" class="form-control" name="merchAddress" id="merchAddress" placeholder="">
            </div>
        </div>

        <div class="form-group">
            <label for="merchRemark" class="col-sm-3 control-label">备注 :</label>
            <div class="col-sm-8">
                <textarea placeholder="" th:text="${merch.merchRemark}" class="form-control" name="merchRemark" id="merchRemark"></textarea>
            </div>
        </div>

    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <div class="pull-right">
            <button type="button" id="saveDetailAgent" class="btn btn-info">确定</button>
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
        </div>
    </div>
    <!-- /.box-footer -->
</form>

<script>
    $(function () {
        $("#saveDetailAgent").on('click', function () {
            if(doValidForm(merchDetailForm)){
                Core.mask("#saveDetailAgent")
                Core.postAjax(ctxPath + "/merch/edit",$("#merchDetailForm").serialize(),function (data) {
                    Core.unmask("#saveDetailAgent");
                    if(data.code==200){
                        $("#merchDetailModal").modal("hide");
                        Core.refreshJqTable("#table_list",true);
                    }
                    layer.msg(data.msg);
                })
            }
        })
    });
</script>